package com.jeff.tianti.controller;

import com.jeff.tianti.cms.service.AdvSpaceService;
import com.jeff.tianti.common.dto.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/advSpace")
@CrossOrigin(maxAge = 3600)
public class AdvSpaceController {
    @Autowired
    AdvSpaceService advSpaceService;

    @RequestMapping(value = "/listByCode", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public AjaxResult getAdvSpaceByCode(String code) {
        return AjaxResult.setSuccessData(advSpaceService.findByDicCode(code));
    }
}
